package com.zzyl.controller.customer;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.controller.BaseController;
import com.zzyl.service.OrdersProjectService;
import com.zzyl.vo.NursingProjectVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/customer/orders/project")
@Api(tags = "客户订单项目接口")
public class CustomerOrdersProjectController extends BaseController {

    @Autowired
    private OrdersProjectService ordersProjectService;

    @GetMapping("/page")
    @ApiOperation("分页查询护理项目列表")
    public ResponseResult<PageResponse<NursingProjectVo>> queryPageNursingProject(
            @RequestParam("pageNum") Integer pageNum,
            @RequestParam("pageSize") Integer pageSize,
            String name,
            Integer status) {
        PageResponse<NursingProjectVo> queryPageNursingProject = ordersProjectService.queryPageNursingProject(name, pageNum, pageSize, status);
        return success(queryPageNursingProject);
    }

    @GetMapping("/{id}")
    @ApiOperation("根据编号查询护理项目信息")
    public ResponseResult<NursingProjectVo> getNursingProjectById(@PathVariable Integer id) {
        NursingProjectVo nursingProjectVo = ordersProjectService.getNursingProjectById(id);
        return success(nursingProjectVo);
    }
}
